package com.xunfang.controller;

import com.xunfang.bean.Result;
import com.xunfang.bean.User;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author yellow Docter
 * @date 2023 -10-11
 * @desc
 */
@RestController
@RequestMapping("user")
public class UserController {

    //数据的绑定
    @RequestMapping("data")
    public Result handler01(User user){
        return Result.ok();
    }

    //数据的返回
    @RequestMapping("resp")
    public Result handler02(User user){

        Result result = new Result();
        result.setCode(10001);
        result.setMsg("请求成功...");
        result.setData(user);
        return result;
    }

}
